<html>
<head>
	<title>Google Pick Proxy</title>
	<script type="text/javascript" src="js/jquery.js"></script>
</head>
<body>
<div>
<label>URL :</label>
<input type="text" name="url" id="url" style="width:60%;margin:4px"/> <input type="button" value="fetch" id="fetchBtn"/>
</div>	
<iframe src="" id="output" noborder="noborder" width="100%" height="100%" style="border:solid 1px #dedede">
<link rel="stylesheet" type="text/css" href="">
</iframe>
<div id="container">

</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
	// $('#url').change(function(){
	// 	$('#url').val($('#url').val().replace(/^http/,'https'));
	// })
	$('#url').val('https://stackoverflow.com/questions/5211887/how-to-use-curl-via-a-proxy');
	$('#fetchBtn').click(function(){
		var url = $('#url').val();
		var paramUrl = encodeURIComponent(url);

		console.log(paramUrl);

		//var newUrl = 'https://www-onepick-opensocial.googleusercontent.com/gadgets/proxy?container=0&url='+paramUrl;
		//var newUrl = 'https://docs.google.com/viewer?url=' + paramUrl;
		//console.log(newUrl);
		//window.open(newUrl);
		$('#output').attr('src','pick-proxy.php?url='+url);
		// $.get(newUrl,function(r){
		// 	$$('#output').html(r);
		// });
	})
});
</script>
<?
//https://images-onepick-opensocial.googleusercontent.com/gadgets/proxy?
?>